package com.hnit.care;

import com.hnit.care.netty.NettyServerBootStrap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
public class Example2Application implements CommandLineRunner {

    @Autowired
    NettyServerBootStrap serverBootStrap;

    public static void main(String[] args) {
        SpringApplication.run(Example2Application.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        serverBootStrap.start();
    }
    @Bean
    ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }
}
